package com.example.book.dao;


import com.example.book.model.BookInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Component
public class BookDao {

//    @Value("${book.page.number}")
//    private Integer num;

    public List<BookInfo> mockData() {
        List<BookInfo>  list = new ArrayList<>();
        for (int i = 1; i <= 15; i++) {
            BookInfo bookInfo = new BookInfo();
            bookInfo.setId(i);
            bookInfo.setBookname("图书" + 1);
            bookInfo.setAuthor("作者"+i);
            bookInfo.setNum(i+1);
            bookInfo.setPrice(new BigDecimal(i+100));
            bookInfo.setPublisher("出版社"+i);
            if(i%2 == 0){
                bookInfo.setStatus(2);
            }else{
                bookInfo.setStatus(1);
            }
            list.add(bookInfo);
        }
        return list;
    }
}
